package kr.saeildamil.androidstudty.ch05;

import kr.saeildamil.androidstudty.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class FrameEx extends Activity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.frame);

		Button btn = (Button) findViewById(R.id.frame_toggle_btn);
		btn.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				ImageView img = (ImageView) findViewById(R.id.frame_img);
				if (img.getVisibility() == View.VISIBLE) {
					img.setVisibility(View.INVISIBLE);
				} else {
					img.setVisibility(View.VISIBLE);
				}
			}
		});
	}
}